import { PureComponent } from "react";
import withRoute from "../hoc/WithRoute";
class RouteComponent extends PureComponent
{
    handelRoute(id)
    {  
        const { route } = this.props;
        const { navigate } = route;
        navigate('/detail/'+id)
    }

    render()
    {
        return (
            <div>
                <h2>RouteComponent</h2>
                <button onClick={()=>{this.handelRoute(111)}}>导航到详情页</button>
            </div>
        )
    }
}

export default withRoute(RouteComponent);

